home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  3.3 KB  |  111 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        CommResources.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.     UNIT CommResources;
  18.     INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingCommResources}
  22. {$SETC UsingCommResources := 1}
  23.  
  24. {$I+}
  25. {$SETC CommResourcesIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingOSUtils}
  28. {$I $$Shell(PInterfaces)OSUtils.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := CommResourcesIncludes}
  31.  
  32. CONST
  33.  
  34. {    version of the Comm Resource Manager    }
  35. curCRMVersion     =     2;
  36.  
  37. {    tool classes (also the tool file types)    }
  38. classCM         =    'cbnd';
  39. classFT         =    'fbnd';
  40. classTM            =    'tbnd';
  41.  
  42. {    constants general to the use of the Communications Resource Manager }
  43. crmType         =     9;                { queue type }
  44. crmRecVersion    =     1;                { version of queue structure }
  45.  
  46. {    error codes }
  47. crmGenericError    =    -1;
  48. crmNoErr        =    0;
  49.  
  50. TYPE
  51. {    data structures general to the use of the Communications Resource Manager }
  52. CRMErr            =    OSErr;
  53.  
  54. CRMRecPtr         = ^CRMRec;
  55. CRMRec             = RECORD
  56.     qLink:             QElemPtr;      {reserved}
  57.     qType:             INTEGER;      {queue type -- ORD(crmType) = 9}
  58.     crmVersion:     INTEGER;    {version of queue element data structure}
  59.     crmPrivate:     LONGINT;    {reserved}
  60.     crmReserved:     INTEGER;       {reserved}
  61.     crmDeviceType:     LONGINT;    {type of device, assigned by DTS}
  62.     crmDeviceID:     LONGINT;    {device ID; assigned when CRMInstall is called}
  63.     crmAttributes:     LONGINT;    {pointer to attribute block}
  64.     crmStatus:         LONGINT;    {status variable - device specific}
  65.     crmRefCon:         LONGINT;    {for device private use}
  66.     END;
  67.  
  68.  
  69. FUNCTION     InitCRM: CRMErr;
  70. FUNCTION     CRMGetHeader: QHdrPtr;
  71. PROCEDURE     CRMInstall(crmReqPtr: QElemPtr);
  72. FUNCTION     CRMRemove(crmReqPtr: QElemPtr): OSErr;
  73. FUNCTION     CRMSearch(crmReqPtr: QElemPtr): QElemPtr;    
  74. FUNCTION     CRMGetCRMVersion: INTEGER;
  75.  
  76. FUNCTION     CRMGetResource(theType: ResType;theID: INTEGER): Handle;
  77. FUNCTION     CRMGet1Resource(theType: ResType;theID: INTEGER): Handle;
  78. FUNCTION     CRMGetIndResource(theType: ResType;index: INTEGER): Handle;
  79. FUNCTION     CRMGet1IndResource(theType: ResType;index: INTEGER): Handle;
  80. FUNCTION     CRMGetNamedResource(theType: ResType;name: Str255): Handle;
  81. FUNCTION     CRMGet1NamedResource(theType: ResType;name: Str255): Handle;
  82. PROCEDURE     CRMReleaseResource(theHandle: Handle);
  83. FUNCTION     CRMGetToolResource(procID: INTEGER;theType: ResType;theID: INTEGER): Handle;
  84. FUNCTION     CRMGetToolNamedResource(procID: INTEGER;theType: ResType;name: Str255): Handle;
  85. PROCEDURE     CRMReleaseToolResource(procID: INTEGER;theHandle: Handle);
  86. FUNCTION     CRMGetIndex(theHandle: Handle): LONGINT;
  87.  
  88. FUNCTION     CRMLocalToRealID(bundleType: ResType;toolID: INTEGER;theType: ResType;
  89.                      localID: INTEGER): INTEGER;
  90. FUNCTION     CRMRealToLocalID(bundleType: ResType;toolID: INTEGER;theType: ResType;
  91.                      realID: INTEGER): INTEGER;
  92.                     
  93. FUNCTION    CRMGetIndToolName(bundleType: OSType;index: INTEGER;VAR toolName: Str255): OSErr;
  94.  
  95. FUNCTION    CRMFindCommunications(VAR vRefNum: INTEGER;VAR dirID: LONGINT): OSErr;
  96.  
  97. FUNCTION    CRMIsDriverOpen(driverName: Str255): BOOLEAN;
  98.  
  99. FUNCTION    CRMParseCAPSResource(theHandle: Handle;selector: ResType;VAR value: LONGINT): CRMErr;
  100.  
  101. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  102. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  103.  
  104.  
  105. {$ENDC} { UsingCommResources }
  106.  
  107. {$IFC NOT UsingIncludes}
  108.     END.
  109. {$ENDC}
  110.  
  111.